﻿namespace WinForms.ControlList.Procurement
{
    using Bll.Comm;
    using Bll.Company;
    using Bll.Procurement;
    using Bll.Supplier;
    using Bll.Systems;
    using Model.Comm;
    using Model.Company;
    using Model.Procurement;
    using Model.Supplier;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.ControlList.Systems;
    using WinForms.Properties;

    public class FrmProcurementPrint : Form
    {
        private DataGridViewTextBoxColumn AllMoney;
        private DataGridViewTextBoxColumn Amount;
        private DataGridViewTextBoxColumn AmoutMoney;
        private DataGridViewTextBoxColumn AmoutUnit;
        private Button btn_Close;
        private Button btn_Print;
        private Button btn_printSet;
        private Button btn_PrintVeiw;
        private DataGridViewTextBoxColumn CommName;
        private DataGridViewTextBoxColumn CommType;
        private IContainer components;
        private DataGridView DataGridList;
        private DataGridViewTextBoxColumn Features;
        public const int HTCAPTION = 2;
        private Label label1;
        private Label lbl_AccountValue;
        private Label lbl_BiTian;
        private Label lbl_CreateMan;
        private Label lbl_CreateManValue;
        private Label lbl_CreateTime;
        private Label lbl_CreateTimeValue;
        private Label lbl_IdDocument;
        private Label lbl_IDDocuments;
        private Label lbl_PrintTiltes;
        private Label lbl_Remark;
        private Label lbl_RemarkValue;
        private Label lbl_SupplierId;
        private Label lbl_SupValue;
        private Label lbl_ToMeetMoney;
        private Label lbl_ToMoney;
        private Label lbl_XuanTian;
        private Label lblTitle;
        private DataGridViewTextBoxColumn LotNum;
        private Bitmap memoryImage;
        private PrintDocument MyPrintDocument;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Table1;
        private Panel pan_Table2;
        private Panel pan_Table3;
        private Panel pan_td0;
        private Panel pan_td1;
        private Panel pan_td2;
        private Panel pan_td3;
        private Panel pan_td4;
        private Panel pan_td5;
        private Panel pan_td6;
        private Panel pan_td7;
        private Panel pan_td8;
        private Panel pan_td9;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_BiTian;
        private Panel panel_Button;
        private Panel panel_JianGe;
        private Panel panel_Title;
        private Panel panel_XuanTian;
        private Panel panel1;
        private Panel panel3;
        private Panel panel4;
        private Panel panel9;
        private PrintDialog PrintDialogs;
        private int proid;
        public const int SC_MOVE = 0xf010;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmProcurementPrint()
        {
            this.components = null;
            this.proid = 0;
            this.PrintDialogs = new PrintDialog();
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        public FrmProcurementPrint(int id)
        {
            this.components = null;
            this.proid = 0;
            this.PrintDialogs = new PrintDialog();
            this.proid = id;
            this.InitializeComponent();
            ProcurementEnt model = ProcurementBll.GetModel(id);
            if (model != null)
            {
                this.lbl_IdDocument.Text = model.IDDocuments;
                this.lbl_RemarkValue.Text = model.Remark;
                this.lbl_ToMoney.Text = model.ToMeetMoney.ToString("F2");
                CompayAccountEnt ent2 = CompayAccountBll.GetModel(model.AccountId);
                this.lbl_AccountValue.Text = ent2.AccountName;
                SupplierEnt ent3 = SupplierBll.GetModel(model.SupplierId);
                this.lbl_SupValue.Text = ent3.SupplierName;
                this.lbl_CreateTimeValue.Text = model.ProcuTime.ToString();
                UserEnt ent4 = UserBll.GetModel(model.ProcuMan);
                if (ent4 != null)
                {
                    this.lbl_CreateManValue.Text = ent4.UserName;
                }
            }
            this.LoadCaiGouMingXi();
            this.PrintDialogs.AllowSomePages = true;
            this.PrintDialogs.ShowHelp = true;
            this.PrintDialogs.Document = this.MyPrintDocument;
            ChainEnt ent6 = ChainBll.GetModel(PublicAppliction.LoginUser.ChainNum);
            this.lbl_PrintTiltes.Text = ent6.ChainName + "入库单 ";
            this.lbl_PrintTiltes.Location = new Point((this.panel_Title.Width - this.lbl_PrintTiltes.Width) / 2, (this.panel_Title.Height - this.lbl_PrintTiltes.Height) / 2);
            PrintSettingEnt ent7 = PrintSettingBll.GetModel(1);
            this.MyPrintDocument.DefaultPageSettings.Margins = new Margins(int.Parse(ent7.LeftMargin.ToString()), int.Parse(ent7.RightMargin.ToString()), int.Parse(ent7.TopMargin.ToString()), int.Parse(ent7.BottomMargin.ToString()));
        }

        [DllImport("gdi32.dll")]
        public static extern long BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            base.Close();
        }

        private void btn_Print_Click(object sender, EventArgs e)
        {
            this.CaptureScreen();
            if (this.PrintDialogs.ShowDialog() == DialogResult.OK)
            {
                this.MyPrintDocument.Print();
                ProcurementEnt model = ProcurementBll.GetModel(this.proid);
                if (model != null)
                {
                    WorkLogBll.AddNewLog("打印采购订单:" + model.IDDocuments, "", PublicAppliction.LoginUser);
                }
            }
        }

        private void btn_printSet_Click(object sender, EventArgs e)
        {
            FrmPrintSetting setting = new FrmPrintSetting();
            if (setting.ShowDialog() == DialogResult.OK)
            {
                PrintSettingEnt model = PrintSettingBll.GetModel(1);
                this.MyPrintDocument.DefaultPageSettings.Margins = new Margins(int.Parse(model.LeftMargin.ToString()), int.Parse(model.RightMargin.ToString()), int.Parse(model.TopMargin.ToString()), int.Parse(model.BottomMargin.ToString()));
            }
        }

        private void btn_PrintVeiw_Click(object sender, EventArgs e)
        {
            this.CaptureScreen();
            new PrintPreviewDialog { Document = this.MyPrintDocument }.ShowDialog();
        }

        private void CaptureScreen()
        {
            this.panel_Button.Visible = false;
            Graphics g = this.pan_AllPlanes.CreateGraphics();
            Size size = this.pan_AllPlanes.Size;
            this.memoryImage = new Bitmap(size.Width, size.Height, g);
            Graphics graphics2 = Graphics.FromImage(this.memoryImage);
            IntPtr hdc = g.GetHdc();
            IntPtr hdcDest = graphics2.GetHdc();
            BitBlt(hdcDest, 0, 0, this.pan_AllPlanes.ClientRectangle.Width, this.pan_AllPlanes.ClientRectangle.Height, hdc, 0, 0, 0xcc0020);
            g.ReleaseHdc(hdc);
            graphics2.ReleaseHdc(hdcDest);
            this.panel_Button.Visible = true;
        }

        protected void DataZhuanHuan(ref DataTable dt)
        {
            dt.Columns["AmoutUnit"].ColumnName = "AmoutUnit1";
            dt.Columns.Add("CommType");
            dt.Columns.Add("AmoutUnit");
            dt.Columns.Add("AllMoney");
            foreach (DataRow row in dt.Rows)
            {
                DataRow[] rowArray = PublicAppliction.ParDt.Select("parid=" + row["AmoutUnit1"].ToString());
                if (rowArray.Length > 0)
                {
                    row["AmoutUnit"] = rowArray[0]["ParName"].ToString();
                }
                CommEnt model = CommBll.GetModel(int.Parse(row["CommId"].ToString()));
                if (model != null)
                {
                    DataRow[] rowArray2 = PublicAppliction.CommTypeDt.Select("CommTypeId=" + model.CommTypeId.ToString());
                    if (rowArray2.Length > 0)
                    {
                        row["CommType"] = rowArray2[0]["CommTypeName"].ToString();
                    }
                }
                row["AllMoney"] = decimal.Parse(row["AmoutMoney"].ToString()) * decimal.Parse(row["Amount"].ToString());
            }
            dt.Columns.Remove("AmoutUnit1");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmProcurementPrint_Load(object sender, EventArgs e)
        {
            this.DataGridList.ClearSelection();
            this.MyPrintDocument.OriginAtMargins = true;
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.LotNum = new DataGridViewTextBoxColumn();
            this.CommType = new DataGridViewTextBoxColumn();
            this.CommName = new DataGridViewTextBoxColumn();
            this.AmoutMoney = new DataGridViewTextBoxColumn();
            this.Amount = new DataGridViewTextBoxColumn();
            this.AllMoney = new DataGridViewTextBoxColumn();
            this.AmoutUnit = new DataGridViewTextBoxColumn();
            this.Features = new DataGridViewTextBoxColumn();
            this.panel4 = new Panel();
            this.panel3 = new Panel();
            this.lbl_CreateTimeValue = new Label();
            this.lbl_CreateTime = new Label();
            this.lbl_CreateManValue = new Label();
            this.lbl_CreateMan = new Label();
            this.panel1 = new Panel();
            this.panel_XuanTian = new Panel();
            this.lbl_XuanTian = new Label();
            this.panel_JianGe = new Panel();
            this.pan_Table3 = new Panel();
            this.pan_td9 = new Panel();
            this.lbl_RemarkValue = new Label();
            this.pan_td8 = new Panel();
            this.lbl_Remark = new Label();
            this.pan_Table2 = new Panel();
            this.pan_td7 = new Panel();
            this.lbl_AccountValue = new Label();
            this.pan_td6 = new Panel();
            this.label1 = new Label();
            this.pan_td5 = new Panel();
            this.lbl_ToMoney = new Label();
            this.pan_td4 = new Panel();
            this.lbl_ToMeetMoney = new Label();
            this.pan_Table1 = new Panel();
            this.pan_td3 = new Panel();
            this.lbl_SupValue = new Label();
            this.pan_td2 = new Panel();
            this.lbl_SupplierId = new Label();
            this.pan_td1 = new Panel();
            this.lbl_IdDocument = new Label();
            this.pan_td0 = new Panel();
            this.lbl_IDDocuments = new Label();
            this.panel_BiTian = new Panel();
            this.lbl_BiTian = new Label();
            this.panel_Title = new Panel();
            this.lbl_PrintTiltes = new Label();
            this.panel_Button = new Panel();
            this.btn_PrintVeiw = new Button();
            this.btn_printSet = new Button();
            this.btn_Print = new Button();
            this.btn_Close = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.MyPrintDocument = new PrintDocument();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.panel3.SuspendLayout();
            this.panel_XuanTian.SuspendLayout();
            this.pan_Table3.SuspendLayout();
            this.pan_td9.SuspendLayout();
            this.pan_td8.SuspendLayout();
            this.pan_Table2.SuspendLayout();
            this.pan_td7.SuspendLayout();
            this.pan_td6.SuspendLayout();
            this.pan_td5.SuspendLayout();
            this.pan_td4.SuspendLayout();
            this.pan_Table1.SuspendLayout();
            this.pan_td3.SuspendLayout();
            this.pan_td2.SuspendLayout();
            this.pan_td1.SuspendLayout();
            this.pan_td0.SuspendLayout();
            this.panel_BiTian.SuspendLayout();
            this.panel_Title.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x206);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x2fb, 0x206);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x2f9, 0x205);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.panel4);
            this.pan_AllPlanes.Controls.Add(this.panel3);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.panel_XuanTian);
            this.pan_AllPlanes.Controls.Add(this.panel_JianGe);
            this.pan_AllPlanes.Controls.Add(this.pan_Table3);
            this.pan_AllPlanes.Controls.Add(this.pan_Table2);
            this.pan_AllPlanes.Controls.Add(this.pan_Table1);
            this.pan_AllPlanes.Controls.Add(this.panel_BiTian);
            this.pan_AllPlanes.Controls.Add(this.panel_Title);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x2e5, 0x1f1);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.White;
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.White;
            this.DataGridList.BorderStyle = BorderStyle.None;
            this.DataGridList.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.LotNum, this.CommType, this.CommName, this.AmoutMoney, this.Amount, this.AllMoney, this.AmoutUnit, this.Features });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.Black;
            this.DataGridList.Location = new Point(0, 170);
            this.DataGridList.MultiSelect = false;
            this.DataGridList.Name = "DataGridList";
            this.DataGridList.ReadOnly = true;
            this.DataGridList.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            this.DataGridList.RowHeadersVisible = false;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.SelectionMode = DataGridViewSelectionMode.CellSelect;
            this.DataGridList.Size = new Size(0x2e5, 250);
            this.DataGridList.TabIndex = 20;
            this.LotNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.LotNum.DataPropertyName = "LotNum";
            style6.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style6.BackColor = Color.White;
            this.LotNum.DefaultCellStyle = style6;
            this.LotNum.FillWeight = 150f;
            this.LotNum.HeaderText = "批号";
            this.LotNum.Name = "LotNum";
            this.LotNum.ReadOnly = true;
            this.CommType.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommType.DataPropertyName = "CommType";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.CommType.DefaultCellStyle = style7;
            this.CommType.FillWeight = 150f;
            this.CommType.HeaderText = "商品类型";
            this.CommType.Name = "CommType";
            this.CommType.ReadOnly = true;
            this.CommName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CommName.DataPropertyName = "CommName";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.CommName.DefaultCellStyle = style8;
            this.CommName.FillWeight = 150f;
            this.CommName.HeaderText = "商品名称";
            this.CommName.Name = "CommName";
            this.CommName.ReadOnly = true;
            this.CommName.Resizable = DataGridViewTriState.True;
            this.AmoutMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AmoutMoney.DataPropertyName = "AmoutMoney";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.White;
            this.AmoutMoney.DefaultCellStyle = style9;
            this.AmoutMoney.FillWeight = 90f;
            this.AmoutMoney.HeaderText = "进货价";
            this.AmoutMoney.Name = "AmoutMoney";
            this.AmoutMoney.ReadOnly = true;
            this.Amount.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Amount.DataPropertyName = "Amount";
            this.Amount.FillWeight = 90f;
            this.Amount.HeaderText = "数量";
            this.Amount.Name = "Amount";
            this.Amount.ReadOnly = true;
            this.AllMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AllMoney.DataPropertyName = "AllMoney";
            this.AllMoney.FillWeight = 90f;
            this.AllMoney.HeaderText = "总价";
            this.AllMoney.Name = "AllMoney";
            this.AllMoney.ReadOnly = true;
            this.AmoutUnit.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.AmoutUnit.DataPropertyName = "AmoutUnit";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.AmoutUnit.DefaultCellStyle = style10;
            this.AmoutUnit.FillWeight = 90f;
            this.AmoutUnit.HeaderText = "单位";
            this.AmoutUnit.Name = "AmoutUnit";
            this.AmoutUnit.ReadOnly = true;
            this.Features.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Features.DataPropertyName = "Features";
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = Color.White;
            this.Features.DefaultCellStyle = style11;
            this.Features.FillWeight = 150f;
            this.Features.HeaderText = "商品规格";
            this.Features.Name = "Features";
            this.Features.ReadOnly = true;
            this.panel4.Dock = DockStyle.Bottom;
            this.panel4.Location = new Point(0, 420);
            this.panel4.Name = "panel4";
            this.panel4.Size = new Size(0x2e5, 5);
            this.panel4.TabIndex = 13;
            this.panel3.Controls.Add(this.lbl_CreateTimeValue);
            this.panel3.Controls.Add(this.lbl_CreateTime);
            this.panel3.Controls.Add(this.lbl_CreateManValue);
            this.panel3.Controls.Add(this.lbl_CreateMan);
            this.panel3.Dock = DockStyle.Bottom;
            this.panel3.Location = new Point(0, 0x1a9);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(0x2e5, 0x19);
            this.panel3.TabIndex = 12;
            this.panel3.Paint += new PaintEventHandler(this.panel3_Paint);
            this.lbl_CreateTimeValue.AutoSize = true;
            this.lbl_CreateTimeValue.Location = new Point(530, 6);
            this.lbl_CreateTimeValue.Name = "lbl_CreateTimeValue";
            this.lbl_CreateTimeValue.Size = new Size(0, 12);
            this.lbl_CreateTimeValue.TabIndex = 2;
            this.lbl_CreateTime.Location = new Point(440, 6);
            this.lbl_CreateTime.Name = "lbl_CreateTime";
            this.lbl_CreateTime.Size = new Size(0x54, 12);
            this.lbl_CreateTime.TabIndex = 0;
            this.lbl_CreateTime.Text = "入库时间:";
            this.lbl_CreateTime.TextAlign = ContentAlignment.MiddleRight;
            this.lbl_CreateManValue.AutoSize = true;
            this.lbl_CreateManValue.Location = new Point(0xc9, 6);
            this.lbl_CreateManValue.Name = "lbl_CreateManValue";
            this.lbl_CreateManValue.Size = new Size(0x29, 12);
            this.lbl_CreateManValue.TabIndex = 1;
            this.lbl_CreateManValue.Text = "label1";
            this.lbl_CreateMan.AutoSize = true;
            this.lbl_CreateMan.Location = new Point(0x9a, 6);
            this.lbl_CreateMan.Name = "lbl_CreateMan";
            this.lbl_CreateMan.Size = new Size(0x2f, 12);
            this.lbl_CreateMan.TabIndex = 0;
            this.lbl_CreateMan.Text = "入库人:";
            this.panel1.Dock = DockStyle.Bottom;
            this.panel1.Location = new Point(0, 450);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x2e5, 5);
            this.panel1.TabIndex = 10;
            this.panel_XuanTian.Controls.Add(this.lbl_XuanTian);
            this.panel_XuanTian.Dock = DockStyle.Top;
            this.panel_XuanTian.Location = new Point(0, 0x91);
            this.panel_XuanTian.Name = "panel_XuanTian";
            this.panel_XuanTian.Size = new Size(0x2e5, 0x19);
            this.panel_XuanTian.TabIndex = 2;
            this.panel_XuanTian.Paint += new PaintEventHandler(this.panel_XuanTian_Paint);
            this.lbl_XuanTian.AutoSize = true;
            this.lbl_XuanTian.Location = new Point(10, 6);
            this.lbl_XuanTian.Name = "lbl_XuanTian";
            this.lbl_XuanTian.Size = new Size(0x35, 12);
            this.lbl_XuanTian.TabIndex = 0;
            this.lbl_XuanTian.Text = "入库信息";
            this.panel_JianGe.Dock = DockStyle.Top;
            this.panel_JianGe.Location = new Point(0, 0x87);
            this.panel_JianGe.Name = "panel_JianGe";
            this.panel_JianGe.Size = new Size(0x2e5, 10);
            this.panel_JianGe.TabIndex = 3;
            this.pan_Table3.Controls.Add(this.pan_td9);
            this.pan_Table3.Controls.Add(this.pan_td8);
            this.pan_Table3.Dock = DockStyle.Top;
            this.pan_Table3.Location = new Point(0, 110);
            this.pan_Table3.Name = "pan_Table3";
            this.pan_Table3.Size = new Size(0x2e5, 0x19);
            this.pan_Table3.TabIndex = 4;
            this.pan_td9.Controls.Add(this.lbl_RemarkValue);
            this.pan_td9.Dock = DockStyle.Fill;
            this.pan_td9.Location = new Point(140, 0);
            this.pan_td9.Name = "pan_td9";
            this.pan_td9.Size = new Size(0x259, 0x19);
            this.pan_td9.TabIndex = 2;
            this.pan_td9.Paint += new PaintEventHandler(this.pan_td9_Paint);
            this.lbl_RemarkValue.AutoSize = true;
            this.lbl_RemarkValue.Location = new Point(6, 5);
            this.lbl_RemarkValue.Name = "lbl_RemarkValue";
            this.lbl_RemarkValue.Size = new Size(0x29, 12);
            this.lbl_RemarkValue.TabIndex = 1;
            this.lbl_RemarkValue.Text = "label4";
            this.pan_td8.Controls.Add(this.lbl_Remark);
            this.pan_td8.Dock = DockStyle.Left;
            this.pan_td8.Location = new Point(0, 0);
            this.pan_td8.Name = "pan_td8";
            this.pan_td8.Size = new Size(140, 0x19);
            this.pan_td8.TabIndex = 3;
            this.pan_td8.Paint += new PaintEventHandler(this.pan_td8_Paint);
            this.lbl_Remark.Location = new Point(50, 6);
            this.lbl_Remark.Name = "lbl_Remark";
            this.lbl_Remark.Size = new Size(0x54, 12);
            this.lbl_Remark.TabIndex = 0;
            this.lbl_Remark.Text = "备注:";
            this.lbl_Remark.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table2.Controls.Add(this.pan_td7);
            this.pan_Table2.Controls.Add(this.pan_td6);
            this.pan_Table2.Controls.Add(this.pan_td5);
            this.pan_Table2.Controls.Add(this.pan_td4);
            this.pan_Table2.Dock = DockStyle.Top;
            this.pan_Table2.Location = new Point(0, 0x55);
            this.pan_Table2.Name = "pan_Table2";
            this.pan_Table2.Size = new Size(0x2e5, 0x19);
            this.pan_Table2.TabIndex = 5;
            this.pan_td7.Controls.Add(this.lbl_AccountValue);
            this.pan_td7.Dock = DockStyle.Fill;
            this.pan_td7.Location = new Point(510, 0);
            this.pan_td7.Name = "pan_td7";
            this.pan_td7.Size = new Size(0xe7, 0x19);
            this.pan_td7.TabIndex = 0;
            this.pan_td7.Paint += new PaintEventHandler(this.pan_td7_Paint);
            this.lbl_AccountValue.AutoSize = true;
            this.lbl_AccountValue.Location = new Point(6, 5);
            this.lbl_AccountValue.Name = "lbl_AccountValue";
            this.lbl_AccountValue.Size = new Size(0x29, 12);
            this.lbl_AccountValue.TabIndex = 1;
            this.lbl_AccountValue.Text = "label6";
            this.pan_td6.Controls.Add(this.label1);
            this.pan_td6.Dock = DockStyle.Left;
            this.pan_td6.Location = new Point(370, 0);
            this.pan_td6.Name = "pan_td6";
            this.pan_td6.Size = new Size(140, 0x19);
            this.pan_td6.TabIndex = 1;
            this.pan_td6.Paint += new PaintEventHandler(this.pan_td6_Paint);
            this.label1.Location = new Point(50, 6);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x54, 12);
            this.label1.TabIndex = 1;
            this.label1.Text = "付款帐户:";
            this.label1.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td5.Controls.Add(this.lbl_ToMoney);
            this.pan_td5.Dock = DockStyle.Left;
            this.pan_td5.Location = new Point(140, 0);
            this.pan_td5.Name = "pan_td5";
            this.pan_td5.Size = new Size(230, 0x19);
            this.pan_td5.TabIndex = 2;
            this.pan_td5.Paint += new PaintEventHandler(this.pan_td5_Paint);
            this.lbl_ToMoney.AutoSize = true;
            this.lbl_ToMoney.Location = new Point(6, 5);
            this.lbl_ToMoney.Name = "lbl_ToMoney";
            this.lbl_ToMoney.Size = new Size(0x29, 12);
            this.lbl_ToMoney.TabIndex = 1;
            this.lbl_ToMoney.Text = "label3";
            this.pan_td4.Controls.Add(this.lbl_ToMeetMoney);
            this.pan_td4.Dock = DockStyle.Left;
            this.pan_td4.Location = new Point(0, 0);
            this.pan_td4.Name = "pan_td4";
            this.pan_td4.Size = new Size(140, 0x19);
            this.pan_td4.TabIndex = 3;
            this.pan_td4.Paint += new PaintEventHandler(this.pan_td4_Paint);
            this.lbl_ToMeetMoney.Location = new Point(50, 5);
            this.lbl_ToMeetMoney.Name = "lbl_ToMeetMoney";
            this.lbl_ToMeetMoney.Size = new Size(0x54, 12);
            this.lbl_ToMeetMoney.TabIndex = 0;
            this.lbl_ToMeetMoney.Text = "应付金额:";
            this.lbl_ToMeetMoney.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table1.Controls.Add(this.pan_td3);
            this.pan_Table1.Controls.Add(this.pan_td2);
            this.pan_Table1.Controls.Add(this.pan_td1);
            this.pan_Table1.Controls.Add(this.pan_td0);
            this.pan_Table1.Dock = DockStyle.Top;
            this.pan_Table1.Location = new Point(0, 60);
            this.pan_Table1.Name = "pan_Table1";
            this.pan_Table1.Size = new Size(0x2e5, 0x19);
            this.pan_Table1.TabIndex = 6;
            this.pan_td3.Controls.Add(this.lbl_SupValue);
            this.pan_td3.Dock = DockStyle.Fill;
            this.pan_td3.Location = new Point(510, 0);
            this.pan_td3.Name = "pan_td3";
            this.pan_td3.Size = new Size(0xe7, 0x19);
            this.pan_td3.TabIndex = 0;
            this.pan_td3.Paint += new PaintEventHandler(this.pan_td3_Paint);
            this.lbl_SupValue.AutoSize = true;
            this.lbl_SupValue.Location = new Point(6, 5);
            this.lbl_SupValue.Name = "lbl_SupValue";
            this.lbl_SupValue.Size = new Size(0x29, 12);
            this.lbl_SupValue.TabIndex = 1;
            this.lbl_SupValue.Text = "label5";
            this.pan_td2.Controls.Add(this.lbl_SupplierId);
            this.pan_td2.Dock = DockStyle.Left;
            this.pan_td2.Location = new Point(370, 0);
            this.pan_td2.Name = "pan_td2";
            this.pan_td2.Size = new Size(140, 0x19);
            this.pan_td2.TabIndex = 1;
            this.pan_td2.Paint += new PaintEventHandler(this.pan_td2_Paint);
            this.lbl_SupplierId.Location = new Point(50, 6);
            this.lbl_SupplierId.Name = "lbl_SupplierId";
            this.lbl_SupplierId.Size = new Size(0x54, 12);
            this.lbl_SupplierId.TabIndex = 0;
            this.lbl_SupplierId.Text = "供货商:";
            this.lbl_SupplierId.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td1.Controls.Add(this.lbl_IdDocument);
            this.pan_td1.Dock = DockStyle.Left;
            this.pan_td1.Location = new Point(140, 0);
            this.pan_td1.Name = "pan_td1";
            this.pan_td1.Size = new Size(230, 0x19);
            this.pan_td1.TabIndex = 2;
            this.pan_td1.Paint += new PaintEventHandler(this.pan_td1_Paint);
            this.lbl_IdDocument.AutoSize = true;
            this.lbl_IdDocument.Location = new Point(6, 6);
            this.lbl_IdDocument.Name = "lbl_IdDocument";
            this.lbl_IdDocument.Size = new Size(0x29, 12);
            this.lbl_IdDocument.TabIndex = 2;
            this.lbl_IdDocument.Text = "label2";
            this.pan_td0.Controls.Add(this.lbl_IDDocuments);
            this.pan_td0.Dock = DockStyle.Left;
            this.pan_td0.Location = new Point(0, 0);
            this.pan_td0.Name = "pan_td0";
            this.pan_td0.Size = new Size(140, 0x19);
            this.pan_td0.TabIndex = 3;
            this.pan_td0.Paint += new PaintEventHandler(this.pan_td0_Paint);
            this.lbl_IDDocuments.Location = new Point(50, 6);
            this.lbl_IDDocuments.Name = "lbl_IDDocuments";
            this.lbl_IDDocuments.Size = new Size(0x54, 12);
            this.lbl_IDDocuments.TabIndex = 0;
            this.lbl_IDDocuments.Text = "单据编号:";
            this.lbl_IDDocuments.TextAlign = ContentAlignment.MiddleRight;
            this.panel_BiTian.Controls.Add(this.lbl_BiTian);
            this.panel_BiTian.Dock = DockStyle.Top;
            this.panel_BiTian.Location = new Point(0, 0x23);
            this.panel_BiTian.Name = "panel_BiTian";
            this.panel_BiTian.Size = new Size(0x2e5, 0x19);
            this.panel_BiTian.TabIndex = 7;
            this.panel_BiTian.Paint += new PaintEventHandler(this.panel_BiTian_Paint);
            this.lbl_BiTian.AutoSize = true;
            this.lbl_BiTian.Location = new Point(10, 6);
            this.lbl_BiTian.Name = "lbl_BiTian";
            this.lbl_BiTian.Size = new Size(0x35, 12);
            this.lbl_BiTian.TabIndex = 0;
            this.lbl_BiTian.Text = "基本信息";
            this.panel_Title.Controls.Add(this.lbl_PrintTiltes);
            this.panel_Title.Dock = DockStyle.Top;
            this.panel_Title.Location = new Point(0, 0);
            this.panel_Title.Name = "panel_Title";
            this.panel_Title.Size = new Size(0x2e5, 0x23);
            this.panel_Title.TabIndex = 7;
            this.lbl_PrintTiltes.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.lbl_PrintTiltes.AutoSize = true;
            this.lbl_PrintTiltes.Font = new Font("宋体", 15.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lbl_PrintTiltes.Location = new Point(0x185, 7);
            this.lbl_PrintTiltes.Name = "lbl_PrintTiltes";
            this.lbl_PrintTiltes.Size = new Size(0, 0x15);
            this.lbl_PrintTiltes.TabIndex = 0;
            this.panel_Button.Controls.Add(this.btn_PrintVeiw);
            this.panel_Button.Controls.Add(this.btn_printSet);
            this.panel_Button.Controls.Add(this.btn_Print);
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 0x1c7);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(0x2e5, 0x25);
            this.panel_Button.TabIndex = 8;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.btn_PrintVeiw.Location = new Point(0x11d, 7);
            this.btn_PrintVeiw.Name = "btn_PrintVeiw";
            this.btn_PrintVeiw.Size = new Size(0x4b, 0x17);
            this.btn_PrintVeiw.TabIndex = 11;
            this.btn_PrintVeiw.Text = "打印预览";
            this.btn_PrintVeiw.UseVisualStyleBackColor = true;
            this.btn_PrintVeiw.Click += new EventHandler(this.btn_PrintVeiw_Click);
            this.btn_printSet.Location = new Point(380, 7);
            this.btn_printSet.Name = "btn_printSet";
            this.btn_printSet.Size = new Size(0x4b, 0x17);
            this.btn_printSet.TabIndex = 10;
            this.btn_printSet.Text = "打印设置";
            this.btn_printSet.UseVisualStyleBackColor = true;
            this.btn_printSet.Click += new EventHandler(this.btn_printSet_Click);
            this.btn_Print.Location = new Point(190, 7);
            this.btn_Print.Name = "btn_Print";
            this.btn_Print.Size = new Size(0x4b, 0x17);
            this.btn_Print.TabIndex = 9;
            this.btn_Print.Text = "打 印";
            this.btn_Print.UseVisualStyleBackColor = true;
            this.btn_Print.Click += new EventHandler(this.btn_Print_Click);
            this.btn_Close.Location = new Point(0x1db, 7);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 8;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x1ec);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x2e5, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x2ef, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x1f1);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x1f1);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x1fb);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x2f9, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x2f9, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x205);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x2f9, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x2fa, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x206);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x2fb, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x2d7, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x4d, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "打印入库单";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x2f6, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            this.MyPrintDocument.PrintPage += new PrintPageEventHandler(this.MyPrintDocument_PrintPage);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x2fb, 550);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmProcurementPrint";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.Load += new EventHandler(this.FrmProcurementPrint_Load);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel_XuanTian.ResumeLayout(false);
            this.panel_XuanTian.PerformLayout();
            this.pan_Table3.ResumeLayout(false);
            this.pan_td9.ResumeLayout(false);
            this.pan_td9.PerformLayout();
            this.pan_td8.ResumeLayout(false);
            this.pan_Table2.ResumeLayout(false);
            this.pan_td7.ResumeLayout(false);
            this.pan_td7.PerformLayout();
            this.pan_td6.ResumeLayout(false);
            this.pan_td5.ResumeLayout(false);
            this.pan_td5.PerformLayout();
            this.pan_td4.ResumeLayout(false);
            this.pan_Table1.ResumeLayout(false);
            this.pan_td3.ResumeLayout(false);
            this.pan_td3.PerformLayout();
            this.pan_td2.ResumeLayout(false);
            this.pan_td1.ResumeLayout(false);
            this.pan_td1.PerformLayout();
            this.pan_td0.ResumeLayout(false);
            this.panel_BiTian.ResumeLayout(false);
            this.panel_BiTian.PerformLayout();
            this.panel_Title.ResumeLayout(false);
            this.panel_Title.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void LoadCaiGouMingXi()
        {
            DataTable list = ProcurementCommBuyBll.GetList("ProcurementId=" + this.proid.ToString());
            this.DataGridList.AutoGenerateColumns = false;
            this.DataZhuanHuan(ref list);
            this.DataGridList.DataSource = list;
        }

        private void MyPrintDocument_PrintPage(object sender, PrintPageEventArgs e)
        {
            this.DataGridList.ClearSelection();
            e.Graphics.DrawImage(this.memoryImage, 0, 0);
        }

        private void pan_td0_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td0, Color.Black, 1, 0, 1, 1);
        }

        private void pan_td1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td1, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td2, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td3, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td4_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td4, Color.Black, 1, 0, 1, 1);
        }

        private void pan_td5_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td5, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td6_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td6, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td7_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td7, Color.Black, 0, 0, 1, 1);
        }

        private void pan_td8_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td8, Color.Black, 1, 0, 1, 1);
        }

        private void pan_td9_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td9, Color.Black, 0, 0, 1, 1);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_BiTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_BiTian, Color.Black, 1, 1, 1, 1);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.Black, 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        private void panel_XuanTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_XuanTian, Color.Black, 1, 1, 1, 0);
        }

        private void panel3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel3, Color.Black, 1, 1, 1, 1);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private bool SetupThePrinting()
        {
            PrintDialog dialog = new PrintDialog {
                AllowCurrentPage = false,
                AllowPrintToFile = false,
                AllowSelection = false,
                AllowSomePages = false,
                PrintToFile = false,
                ShowHelp = false,
                ShowNetwork = false
            };
            this.MyPrintDocument.DocumentName = "采购单";
            this.MyPrintDocument.PrinterSettings = dialog.PrinterSettings;
            this.MyPrintDocument.DefaultPageSettings = dialog.PrinterSettings.DefaultPageSettings;
            return true;
        }
    }
}

